#ifndef _FUZZY_CLUSTER_H_
# define _FUZZY_CLUSTER_H_

#include "utility.h"

#define DEFAULT_MAX_CLUSTER_SIZE 20
#define DEFAULT_MIN_CLUSTER_SIZE 3
#define DEFAULT_NUM_HIGH_PAGE_RANK 10
#define DEFAULT_PAGE_RANK_ITERATIONS 10

#define DEFAULT_DEBUG_LEVEL 1
#define DEFAULT_CLUSTER_GRAPH_SAVE_PREFIX "cluster-"
#define DEFAULT_CLUSTER_GRAPH_SAVE_POSTFIX ".gr"

#define MAX_READ_LENGTH 1048576

typedef struct {
	unsigned int cluster_count;
	double coefficient_sum;
} cluster_stats;

typedef struct {
	unsigned int max_cluster_size;
	unsigned int min_cluster_size;
	unsigned int page_rank_ignore;
	unsigned int addIter;

	int debug;
	char *prefix;
	char *graph;

	cluster_stats stats;
} options;

GraphFrame *
graph_of_component(GraphFrame *graph, unsigned int component_number);

void
findClusters(GraphFrame *graph, options *fc_opts);

void
findClustersInConnectedComponent(GraphFrame *component, options *fc_opts);

GraphFrame *
load_graph(char *filename);

void
save_graph_context(GraphFrame *graph, char *filename,void *context);

void
save_graph(GraphFrame *graph, char *filename);

#endif
